// AlarmTrayIcon.h
#ifndef ALARMTARYICON_H
#define ALARMTARYICON_H

#include <QSystemTrayIcon>
#include <QTimer>

class AlarmTrayIcon : public QSystemTrayIcon {
    Q_OBJECT
public:
    explicit AlarmTrayIcon(QObject *parent = nullptr);

    void startFlashing();  // 开始闪烁
    void stopFlashing();   // 停止闪烁

signals:
    void alarmTriggered(); // 闹钟触发信号

private slots:
    void onTimeout();      // 定时器回调

private:
    QTimer *flashTimer;
    QIcon normalIcon;
    QIcon alertIcon;
    bool isFlashing = false;
};

#endif // ALARMTARYICON_H
